<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>PHPEMS模拟考试系统</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" type="text/css" href="app/core/styles/css/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="app/core/styles/css/datetimepicker.css" />
	<link rel="stylesheet" type="text/css" href="app/core/styles/css/jquery-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="app/core/styles/css/peskin.css" />
	<!--[if lt IE 9]>
	<script src="app/core/styles/js/html5shiv.min.js"></script>
	<script src="app/core/styles/js/respond.min.js"></script>
	<![endif]-->
	<script src="app/core/styles/js/jquery.min.js"></script>
	<script src="app/core/styles/js/jquery.json.js"></script>
	<script src="app/core/styles/js/jquery-ui.min.js"></script>
	<script src="app/core/styles/js/bootstrap.min.js"></script>
	<script src="app/core/styles/js/bootstrap-datetimepicker.js"></script>
	<script src="app/core/styles/js/all.fine-uploader.min.js"></script>
	<script src="app/core/styles/js/ckeditor/ckeditor.js"></script>
	<script src="app/core/styles/js/plugin.js"></script>
	<script src="app/exam/styles/js/plugin.js"></script>
</head><body data-spy="scroll" data-target="#myScrollspy">
<div class="container-fluid" id="questioncontent">
	<div class="row-fluid">
		<div class="main box">
			<div class="col-xs-3" id="questionbar">
				<dl class="clear" style="width:270px;" data-spy="affix" data-offset-top="235" id="questionindex">
					<dd>
						<h2><a class="btn btn-danger col-xs-12" style="font-size:1.2em;"><span id="timer_h">00</span>：<span id="timer_m">00</span>：<span id="timer_s">00</span></a></h2>
					</dd>
					<dt class="float_l"><h4>&nbsp;</h4></dt>
					<ul class="nav nav-tabs" role="tablist">
																																																<li role="presentation" class="active"><a href="#qt_1" aria-controls="home" role="tab" data-toggle="tab">一</a></li>
																																																																																				<li role="presentation"><a href="#qt_3" aria-controls="home" role="tab" data-toggle="tab">二</a></li>
																																																																																																																	</ul>
					<div class="tab-content" style="margin-top:5px;" id="questionindex">
																																																<div role="tabpanel" class="tab-pane tableindex active" id="qt_1">
										                			                			                							<a id="sign_890" href="javascript:;" onclick="javascript:gotoquestion('890')" class="btn btn-default">1</a>
										                			                							<a id="sign_892" href="javascript:;" onclick="javascript:gotoquestion('892')" class="btn btn-default">2</a>
										                			                							<a id="sign_893" href="javascript:;" onclick="javascript:gotoquestion('893')" class="btn btn-default">3</a>
										                			                							<a id="sign_899" href="javascript:;" onclick="javascript:gotoquestion('899')" class="btn btn-default">4</a>
										                			                							<a id="sign_900" href="javascript:;" onclick="javascript:gotoquestion('900')" class="btn btn-default">5</a>
																				</div>
																																																																														<div role="tabpanel" class="tab-pane tableindex" id="qt_3">
										                			                			                							<a id="sign_896" href="javascript:;" onclick="javascript:gotoquestion('896')" class="btn btn-default">1</a>
										                			                							<a id="sign_897" href="javascript:;" onclick="javascript:gotoquestion('897')" class="btn btn-default">2</a>
										                			                							<a id="sign_902" href="javascript:;" onclick="javascript:gotoquestion('902')" class="btn btn-default">3</a>
										                			                							<a id="sign_903" href="javascript:;" onclick="javascript:gotoquestion('903')" class="btn btn-default">4</a>
																				</div>
																																																																																																																	</div>
				</dl>
			</div>
			<form id="form1" name="form1" method="post" action="index.php?exam-app-exam-score" class="col-xs-9 split pull-right" style="padding:0px;">
				<div class="box itembox">
					<h2 class="text-center">zhangning</h2>
				</div>
																																<div class="box itembox questionpanel" id="questype_1">
					<blockquote class="questype">一、单选题</blockquote>
				</div>
				                                                				<div class="box itembox paperexamcontent" id="questions_890" rel="1">
					<h4 class="title">
						第1题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('890',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_890">
							<input id="time_890" type="hidden" name="time[890]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>你叫什么名字</p>					</div>
															<div class="choice">
                    	<p>A 张宁</p>

<p>B 李下</p>

<p>C 王天</p>

<p>D 赵一</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[890]" rel="890" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[890]" rel="890" value="B" />B </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[890]" rel="890" value="C" />C </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[890]" rel="890" value="D" />D </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(1);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
				                                				<div class="box itembox paperexamcontent" id="questions_892" rel="1">
					<h4 class="title">
						第2题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('892',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_892">
							<input id="time_892" type="hidden" name="time[892]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>儿童节是什么时间?</p>					</div>
															<div class="choice">
                    	<p>A 十月一日</p>

<p>B 八月三日</p>

<p>C 六月一日</p>

<p>D 九月三日</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[892]" rel="892" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[892]" rel="892" value="B" />B </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[892]" rel="892" value="C" />C </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[892]" rel="892" value="D" />D </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(0);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(2);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
				                                				<div class="box itembox paperexamcontent" id="questions_893" rel="1">
					<h4 class="title">
						第3题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('893',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_893">
							<input id="time_893" type="hidden" name="time[893]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>今年是下面哪一年?</p>					</div>
															<div class="choice">
                    	<p>A 2013年</p>

<p>B 2016年</p>

<p>C 2017年</p>

<p>D 2015年</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[893]" rel="893" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[893]" rel="893" value="B" />B </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[893]" rel="893" value="C" />C </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[893]" rel="893" value="D" />D </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(1);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(3);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
				                                				<div class="box itembox paperexamcontent" id="questions_899" rel="1">
					<h4 class="title">
						第4题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('899',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_899">
							<input id="time_899" type="hidden" name="time[899]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>中国的首都是下列哪个城市</p>					</div>
															<div class="choice">
                    	<p>A 上海</p>

<p>B 海南</p>

<p>C 北京</p>

<p>D 天津</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[899]" rel="899" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[899]" rel="899" value="B" />B </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[899]" rel="899" value="C" />C </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[899]" rel="899" value="D" />D </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(2);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(4);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
				                                				<div class="box itembox paperexamcontent" id="questions_900" rel="1">
					<h4 class="title">
						第5题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('900',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_900">
							<input id="time_900" type="hidden" name="time[900]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>中国有多少个民族</p>					</div>
															<div class="choice">
                    	<p>A&nbsp; 50个</p>

<p>B 30个</p>

<p>C 56个</p>

<p>D 59个</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[900]" rel="900" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[900]" rel="900" value="B" />B </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[900]" rel="900" value="C" />C </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[900]" rel="900" value="D" />D </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(3);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(5);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
																																																												<div class="box itembox questionpanel" id="questype_3">
					<blockquote class="questype">二、判断题</blockquote>
				</div>
				                                                				<div class="box itembox paperexamcontent" id="questions_896" rel="3">
					<h4 class="title">
						第1题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('896',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_896">
							<input id="time_896" type="hidden" name="time[896]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>中国的国旗是五星红旗？</p>					</div>
															<div class="choice">
                    	<p>A&nbsp; 对</p>

<p>B 错</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[896]" rel="896" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[896]" rel="896" value="B" />B </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(4);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(6);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
				                                				<div class="box itembox paperexamcontent" id="questions_897" rel="3">
					<h4 class="title">
						第2题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('897',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_897">
							<input id="time_897" type="hidden" name="time[897]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>中国是2008年加入世界贸易组织的。</p>					</div>
															<div class="choice">
                    	<p>A 对</p>

<p>B 错</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[897]" rel="897" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[897]" rel="897" value="B" />B </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(5);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(7);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
				                                				<div class="box itembox paperexamcontent" id="questions_902" rel="3">
					<h4 class="title">
						第3题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('902',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_902">
							<input id="time_902" type="hidden" name="time[902]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>2008年在北京开办了奥运会？</p>					</div>
															<div class="choice">
                    	<p>A 对</p>

<p>B 错</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[902]" rel="902" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[902]" rel="902" value="B" />B </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(6);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																		<a class="pull-right btn btn-primary" onclick="javascript:gotoindexquestion(8);">下一题<span class="glyphicon glyphicon-chevron-right"></span></a>
											</div>
				</div>
				                                				<div class="box itembox paperexamcontent" id="questions_903" rel="3">
					<h4 class="title">
						第4题
						<span class="pull-right">
							<a class="btn btn-info qicon" href="javascript:;" onclick="javascript:signQuestion('903',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
							<a name="question_903">
							<input id="time_903" type="hidden" name="time[903]"/>
						</span>
					</h4>
					<div class="choice">
						</a><p>北京是中国的首都吗？</p>					</div>
															<div class="choice">
                    	<p>A 对</p>

<p>B 错</p>                    </div>
                    					<div class="selector">
                    		                        	                        	                        <label class="radio-inline"><input type="radio" name="question[903]" rel="903" value="A" />A </label>
	                        	                        	                        <label class="radio-inline"><input type="radio" name="question[903]" rel="903" value="B" />B </label>
	                        	                        	                        	                                        </div>
										<div class="toolbar">
												<a class="btn btn-default" onclick="javascript:gotoindexquestion(7);"><span class="glyphicon glyphicon-chevron-left"></span>上一题</a>
																	</div>
				</div>
																																																																																				<h3 class="text-center">
					<input type="hidden" name="insertscore" value="1"/>
					<a class="btn btn-primary" style="font-size:1em;width:270px;" href="#submodal" role="button" data-toggle="modal">交 卷</a>
				</h3>
			</form>
		</div>
	</div>
</div>
<div class="modal fade" id="submodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="myModalLabel">交卷</h4>
			</div>
			<div class="modal-body">
				<p>共有试题 <span class="allquestionnumber">50</span> 题，已做 <span class="yesdonumber">0</span> 题。您确认要交卷吗？</p>
			</div>
			<div class="modal-footer">
				<button type="button" onclick="javascript:submitPaper();" class="btn btn-primary">确定交卷</button>
				<button aria-hidden="true" class="btn" type="button" data-dismiss="modal">再检查一下</button>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
var qindex = 0;
function gotoquestion(questid)
{
	$(".questionpanel").hide();
	$(".paperexamcontent").hide();
	$("#questions_"+questid).show();
	$("#questype_"+$("#questions_"+questid).attr('rel')).show();
}
function gotoindexquestion(index)
{
	$(".questionpanel").hide();
	$(".paperexamcontent").hide();
	$(".paperexamcontent").eq(index).show();
	$("#questype_"+$(".paperexamcontent").eq(index).attr('rel')).show();
}
$(document).ready(function(){
	$.get('index.php?exam-app-index-ajax-lefttime&rand'+Math.random(),function(data){
		var setting = {
						time:60,
						hbox:$("#timer_h"),
			mbox:$("#timer_m"),
			sbox:$("#timer_s"),
			finish:function(){
				submitPaper();
			}
		}
		setting.lefttime = parseInt(data);
		countdown(setting);
	});

	(function(){
		$(".questionpanel").hide();
		$(".questionpanel:first").show();
		$(".paperexamcontent").hide();
		$(".paperexamcontent:first").show();
	})();

	setInterval(saveanswer,120000);

	initData = $.parseJSON(storage.getItem('questions'));
	if(initData){
		for(var p in initData){
			if(p!='set')
			formData[p]=initData[p];
			$("#time_"+$('[name="'+p+'"]').attr('rel')).val(initData[p].time);
		}

		var textarea = $('#form1 textarea');
		$.each(textarea,function(){
			var _this = $(this);
			if(initData[_this.attr('name')])
			{
				_this.val(initData[_this.attr('name')].value);
				CKEDITOR.instances[_this.attr('id')].setData(initData[_this.attr('name')].value);
				if(initData[_this.attr('name')].value && initData[_this.attr('name')].value != '')
				batmark(_this.attr('rel'),initData[_this.attr('name')].value);
			}
		});
		var texts = $('#form1 :input[type=text]');
		$.each(texts,function(){
			var _this = $(this);
			if(initData[_this.attr('name')])
			{
				_this.val(initData[_this.attr('name')]?initData[_this.attr('name')].value:'');
				if(initData[_this.attr('name')].value && initData[_this.attr('name')].value != '')
				batmark(_this.attr('rel'),initData[_this.attr('name')].value);
			}
		});

		var radios = $('#form1 :input[type=radio]');
		$.each(radios,function(){
			var _= this, v = initData[_.name]?initData[_.name].value:null;
			var _this = $(this);
			if(v!=''&&v==_.value){
				_.checked = true;
				batmark(_this.attr('rel'),initData[_this.attr('name')].value);
			}else{
				_.checked=false;
			}
		});

		var checkboxs=$('#form1 :input[type=checkbox]');
		$.each(checkboxs,function(){
			var _=this,v=initData[_.name]?initData[_.name].value:null;
			var _this = $(this);
			if(v!=''&&v==_.value){
				_.checked=true;
				batmark(_this.attr('rel'),initData[_this.attr('name')].value);
			}else{
				_.checked=false;
			}
		});
	}

	$('#form1 :input[type=text]').change(function(){
		var _this=$(this);
		var p=[];
		p.push(_this.attr('name'));
		p.push(_this.val());
		p.push(Date.parse(new Date())/1000);
		$('#time_'+_this.attr('rel')).val(Date.parse(new Date())/1000);
		set.apply(formData,p);
		markQuestion(_this.attr('rel'),true);
	});

	$('#form1 :input[type=radio]').change(function(){
		var _=this;
		var _this=$(this);
		var p=[];
		p.push(_.name);
		if(_.checked){
			p.push(_.value);
			p.push(Date.parse(new Date())/1000);
			$('#time_'+_this.attr('rel')).val(Date.parse(new Date())/1000);
			set.apply(formData,p);
		}else{
			p.push('');
			p.push(null);
			set.apply(formData,p);
		}
		markQuestion(_this.attr('rel'));
	});

	$('#form1 textarea').change(function(){
		var _= this;
		var _this=$(this);
		var p=[];
		p.push(_.name);
		p.push(_.value);
		p.push(Date.parse(new Date())/1000);
		$('#time_'+_this.attr('rel')).val(Date.parse(new Date())/1000);
		set.apply(formData,p);
		markQuestion(_this.attr('rel'),true);
	});
	$('#form1 :input[type=checkbox]').change(function(){
		var _= this;
		var _this = $(this);
		var p=[];
		p.push(_.name);
		if(_.checked){
			p.push(_.value);
			p.push(Date.parse(new Date())/1000);
			$('#time_'+_this.attr('rel')).val(Date.parse(new Date())/1000);
			set.apply(formData,p);
		}else{
			p.push('');
			p.push(null);
			set.apply(formData,p);
		}
		markQuestion(_this.attr('rel'));
	});
	$('.allquestionnumber').html($('.paperexamcontent').length);
	$('.yesdonumber').html($('#questionindex .btn-primary').length);
});
</script>
</body>
</html>